// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ICloudBlobClient.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Exception for errors when handling Windows Azure Cloud Drives.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;

using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Contract for Microsoft.WindowsAzure.StorageClient.CloudBlobClient
	/// </summary>
	public interface ICloudBlobClient
	{
		/// <summary>
		/// The Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ResponseReceived
		/// </summary>
		event EventHandler<ResponseReceivedEventArgs> ResponseReceived;

		/// <summary>
		/// Gets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.Credentials
		/// </summary>
		IStorageCredentials Credentials { get; }

		/// <summary>
		/// Gets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BaseUri
		/// </summary>
		Uri BaseUri { get; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient
		/// </summary>
		RetryPolicy RetryPolicy { get; set; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.Timeout
		/// </summary>
		TimeSpan Timeout { get; set; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.DefaultDelimiter
		/// </summary>
		string DefaultDelimiter { get; set; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.SingleBlobUploadThresholdInBytes
		/// </summary>
		long SingleBlobUploadThresholdInBytes { get; set; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.WriteBlockSizeInBytes
		/// </summary>
		long WriteBlockSizeInBytes { get; set; }

		/// <summary>
		/// Gets or sets the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ReadAheadInBytes
		/// </summary>
		long ReadAheadInBytes { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether the wrapped Microsoft.WindowsAzure.StorageClient.CloudBlobClient.UseIntegrityControlForStreamReading is true.
		/// </summary>
		bool UseIntegrityControlForStreamReading { get; set; }

		/// <summary>
		/// Gets or sets the Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ParallelOperationThreadCount
		/// </summary>
		int ParallelOperationThreadCount { get; set; }

		/// <summary>
		/// Gets the blob reference from Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetPageBlobReference(string).
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address to access the blob.
		/// </param>
		/// <returns>
		/// The get page blob reference as a <see cref="CloudPageBlob"/>.
		/// </returns>
		CloudPageBlob GetPageBlobReference(string blobAddress);

		/// <summary>
		/// Gets the blob reference from Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetPageBlobReference(string,DateTime?)
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address.
		/// </param>
		/// <param name="snapshotTime">
		/// The snapshot Time.
		/// </param>
		/// <returns>
		/// The get page blob reference.
		/// </returns>
		CloudPageBlob GetPageBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// The same as Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetBlobReference(string)
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address.
		/// </param>
		/// <returns>
		/// The get block blob reference.
		/// </returns>
		CloudBlockBlob GetBlockBlobReference(string blobAddress);

		/// <summary>
		/// The same as Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetBlobReference(string,DateTime?)
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address.
		/// </param>
		/// <param name="snapshotTime">
		/// The snapshot Time.
		/// </param>
		/// <returns>
		/// The get block blob reference.
		/// </returns>
		CloudBlockBlob GetBlockBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// The same as Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetBlobReference(string)
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address.
		/// </param>
		/// <returns>
		/// The get blob reference.
		/// </returns>
		CloudBlob GetBlobReference(string blobAddress);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetBlobReference(string,DateTime?)
		/// </summary>
		/// <param name="blobAddress">
		/// The blob Address.
		/// </param>
		/// <param name="snapshotTime">
		/// The snapshot Time.
		/// </param>
		/// <returns>
		/// The get blob reference.
		/// </returns>
		CloudBlob GetBlobReference(string blobAddress, DateTime? snapshotTime);

		/// <summary>
		/// The wrapped version of The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetContainerReference
		/// </summary>
		/// <param name="containerAddress">
		/// The container Address.
		/// </param>
		/// <returns>
		/// The get container reference.
		/// </returns>
		CloudBlobContainer GetContainerReference(string containerAddress);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.GetBlobDirectoryReference
		/// </summary>
		/// <param name="blobDirectoryAddress">
		/// The blob Directory Address.
		/// </param>
		/// <returns>
		/// The get blob directory reference.
		/// </returns>
		CloudBlobDirectory GetBlobDirectoryReference(string blobDirectoryAddress);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainers()
		/// </summary>
		/// <returns>
		/// The list containers.
		/// </returns>
		IEnumerable<CloudBlobContainer> ListContainers();

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainers(string)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <returns>
		/// The list containers.
		/// </returns>
		IEnumerable<CloudBlobContainer> ListContainers(string prefix);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainers(string,ContainerListingDetails)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <returns>
		/// The list containers.
		/// </returns>
		IEnumerable<CloudBlobContainer> ListContainers(string prefix, ContainerListingDetails detailsIncluded);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainersSegmented()
		/// </summary>
		/// <returns>
		/// The list containers segmented.
		/// </returns>
		ResultSegment<CloudBlobContainer> ListContainersSegmented();

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainersSegmented(string)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <returns>
		/// The list containers segmented.
		/// </returns>
		ResultSegment<CloudBlobContainer> ListContainersSegmented(string prefix);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListContainersSegmented(string,ContainerListingDetails,int,ResultContinuation)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <returns>
		/// The list containers segmented.
		/// </returns>
		ResultSegment<CloudBlobContainer> ListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListContainersSegmented(AsyncCallback,object)
		/// </summary>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list containers segmented.
		/// </returns>
		IAsyncResult BeginListContainersSegmented(AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListContainersSegmented(string,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list containers segmented.
		/// </returns>
		IAsyncResult BeginListContainersSegmented(string prefix, AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListContainersSegmented(string,ContainerListingDetails,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list containers segmented.
		/// </returns>
		IAsyncResult BeginListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListContainersSegmented(string,ContainerListingDetails,int,ResultContinuation,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list containers segmented.
		/// </returns>
		IAsyncResult BeginListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.EndListContainersSegmented
		/// </summary>
		/// <param name="asyncResult">
		/// The async Result.
		/// </param>
		/// <returns>
		/// The end list containers segmented.
		/// </returns>
		ResultSegment<CloudBlobContainer> EndListContainersSegmented(IAsyncResult asyncResult);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefix(string)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <returns>
		/// The list blobs with prefix.
		/// </returns>
		IEnumerable<IListBlobItem> ListBlobsWithPrefix(string prefix);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefix(string,BlobRequestOptions)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="options">
		/// The options.
		/// </param>
		/// <returns>
		/// The list blobs with prefix.
		/// </returns>
		IEnumerable<IListBlobItem> ListBlobsWithPrefix(string prefix, BlobRequestOptions options);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefixSegmented(string)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <returns>
		/// The list blobs with prefix segmented.
		/// </returns>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefixSegmented(string,BlobRequestOptions)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="options">
		/// The options.
		/// </param>
		/// <returns>
		/// The list blobs with prefix segmented.
		/// </returns>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, BlobRequestOptions options);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefixSegmented(string,int,ResultContinuation)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <returns>
		/// The list blobs with prefix segmented.
		/// </returns>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.ListBlobsWithPrefixSegmented(string,int,ResultContinuation,BlobRequestOptions)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <param name="options">
		/// The options.
		/// </param>
		/// <returns>
		/// The list blobs with prefix segmented.
		/// </returns>
		ResultSegment<IListBlobItem> ListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken, BlobRequestOptions options);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListBlobsWithPrefixSegmented(string,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list blobs with prefix segmented.
		/// </returns>
		IAsyncResult BeginListBlobsWithPrefixSegmented(string prefix, AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.BeginListBlobsWithPrefixSegmented(string,int,ResultContinuation,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list blobs with prefix segmented.
		/// </returns>
		IAsyncResult BeginListBlobsWithPrefixSegmented(string prefix, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);

		/// <summary>
		/// The wrapped version of Microsoft.WindowsAzure.StorageClient.CloudBlobClient.EndListBlobsWithPrefixSegmented
		/// </summary>
		/// <param name="asyncResult">
		/// The async Result.
		/// </param>
		/// <returns>
		/// The end list blobs with prefix segmented.
		/// </returns>
		ResultSegment<IListBlobItem> EndListBlobsWithPrefixSegmented(IAsyncResult asyncResult);
	}
}